package demo.swing.menu;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class DemoMenu extends JMenuBar {

	
	private JMenu panelsMenu = null;
	private JMenuItem administratorPanelMenuItem = null;
	private JMenuItem exitMenuItem = null;
	private MenuItemListener demoMenuListenver = null;
	/**
	 * 
	 */
	private static final long serialVersionUID = -4200099532055429877L;
	public DemoMenu(){
		super();
		panelsMenu = new JMenu("Panels");
		
		administratorPanelMenuItem = new JMenuItem("Administrator panel");
		exitMenuItem = new JMenuItem("Exit");
		demoMenuListenver = new MenuItemListener(this);
		administratorPanelMenuItem.addActionListener(demoMenuListenver);
		exitMenuItem.addActionListener(demoMenuListenver);
		panelsMenu.add(administratorPanelMenuItem);
		panelsMenu.add(exitMenuItem);
		this.add(panelsMenu);
	}
	public JMenuItem getExitMenuItem() {
		return exitMenuItem;
	}
	public JMenu getPanelsMenu() {
		return panelsMenu;
	}
	public JMenuItem getAdministratorPanelMenuItem() {
		return administratorPanelMenuItem;
	}

}
